<template>
  <div>
    <div class="hello">
      <button @click="sayOut">渲染</button>
    </div>
    <div>用户管理</div>
    <tr >
      <th>用户名</th>
      <th>年龄</th>
    </tr>
    <tr >
      <td>{{userName}}</td>
      <td>{{password}}</td>
    </tr>
  </div>
</template>


<script>
  export default {
    name: 'hello',
    data () {
      return {
        userName:'',
        password:''
      }
    },
    methods:{
      sayOut () {
        this.$axios.post('/user/userData')
          .then((response) => {
            this.userName = response.data.userName;
            this.password = response.data.password;
            console.log(response.data);
          }).catch(err => {
          console.log(err);
        })
      }
    }
  }

</script>

